package demo_designPattern.proxy.dynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;


public class Handler implements InvocationHandler{
    Object target;

    public Handler(Object target) {
	super();
	this.target = target;
    }



    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
	long start = System.currentTimeMillis();
	Object o  =method.invoke(target, args);
	System.out.println(System.currentTimeMillis()-start);
	return o;
    }

}
